import logging

from sqlalchemy import select

from py_engine import session
from py_orm.py_union import User1

logger = logging.getLogger(__name__)


def test_select():
    user_name_list = ['chench1', 'chench2']
    # statement = select([User1]).select_from(User1).where(User1.user_name1.in_(user_name_list))

    statement = select([User1.user_name1, User1.user_id]).select_from(User1).distinct()

    result = session.execute(statement).fetchall()

    pass


def test_where():
    statement = select([User1.user_name1]).select_from(User1).where(User1.user_name1 == 'chench1')

    # statement = statement.where()
    pass


if __name__ == '__main__':
    # test_select()
    test_where()
    pass
